#!/bin/sh # GR journal finder. (c) Steve Braham # #.. To support an ISINDEX type search, set search string if given # an argument on the command line # emailfile="/usr/local/lib/addresses/grpersons" safeit="/usr/local/http/support/safeitgr" unescape="/usr/local/http/support/unescape" if [ $# -gt 0 ]; then PREFIX="search=" fi # #.. Check that a query has been made # if [ $QUERY_STRING ]; then # #.. Strip the variables out from the query string, # and assign them into the environment, prefixed by 'QS_' # # o sed removes any ' that would upset quoted assignment # # o awk ensures that # - all variables passed have legal names # - special characters are not interpreted by sh # # First a security strip search SAFE_QUERY=`$safeit QUERY_STRING` eval `echo $PREFIX$SAFE_QUERY | sed -e 's/'"'"'/%27/g' |awk ' BEGIN{RS="&";FS="="; seclist = ""} $1~/^[a-zA-Z][a-zA-Z0-9_]*$/ { printf "QS_%s=%c%s%c\n",$1,39,$2,39}' ` # #.. Output header # cat << EOM Content-type: text/html GR Journal search output

Search Results

EOM # Unescape search string, extract first word. Further safety check. allpars=`$unescape "$QS_search"` export allpars allpars=`$safeit allpars` firstpar=`echo "$allpars"|awk '{print $1}'` export firstpar firstpar=`$safeit firstpar` # Now set search type. (regex or plain) # A single unknown will be interpreted as an ISINDEX search with # a plain search, case insensitive. case $QS_method in advanced) searcher=egrep ;; simple) searcher=fgrep ;; *) searcher=fgrep ;; esac case $QS_case in sensitive) sea="$searcher" ;; insensitive) sea="$searcher -i" ;; *) sea="$searcher -i" ;; esac #ok, do it $sea "$allpars" $emailfile |fgrep "ZZ"|sed -e 's/ZZ //g' -e 's/, /,\&/g' -e 's/\&Z /\&Z\&/g'| awk -F\& ' BEGIN { found = "0"} found == "0" { print "Matches found."; print "Click on highlighted areas"; print "for institution mail addresses.
"; found = "1"} NF == "7" {print "", $2, "/ "$1 , "" " "$7"", " _____ ", $3, "", $5" "$6, "
"; next } {print "", $2, "/ "$1 , "" " "$6"", " _____ ", $3, "", $5, "
" } END { if (found == "0") { print "Sorry, no information found for: "sstring".

" print "Can attempt" print "people or" print "address" print "search for "fword"."} }' fword="$firstpar" sstring="$allpars" cat <New Searches:

GR People GR Journal GR Address EOE else # #.. The script was called without a query. # Provide an ISINDEX type response for browsers # without form support. # cat << EOM Content-type: text/html GRjournal Gateway

General Relativity E-mail Addresses For Journals and Groups

This is an interface into the General Relativity mailing address list. This service is provided by the UBC GR group, but the list itself is kept by Malcolm MacCallum. This searches the mailing address list for various groups and journals, corresponding to the "ZZ" type of entries. Simply type the name of the journal or group that you wish to find in the dialog box. GRjournal will then display any entry that has that particular string in any field. Case is not sensitive, and all matching entries will be returned, but only a single field will be matched.
Or go to:
GR People GR Address HyperSpace EOM fi echo "
" ls -l $emailfile|awk '{ print "E-mail database last modified on "$5" "$6" "$7"."}' echo "In case of problems, contact:
The Web Master (theoryweb@physics.ubc.ca)
software written by
Steve Braham (braham@physics.ubc.ca)
"